﻿
/*----------------------------------------------------------------//
// 文件名：MoAssDgItem.cs
// 文件功能描述：实体 MoAssDgItem.
// 
// 创建标识：Template  ver 5.0.20090429 2009-07-10
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoAssDgItem
using System;
using System.Data;
namespace Las.Model
{
	/// <summary>
	/// 业务实体MoAssDgItem
	/// </summary>
	public partial class MoAssDgItem:ICloneable
	{
		#region 表AssDgItem的字段
		private string asisId;
		private string adiId;
		private string adiName;
		private int adiAttr;
		#endregion
		
		#region 构造函数
		public MoAssDgItem()
		{
			     	    
		   
		}
		#endregion
		
		#region 拷贝构造函数

		public MoAssDgItem(MoAssDgItem item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoAssDgItem(string asisId,string adiId,string adiName,int adiAttr)
		{
		this.asisId=asisId;
		this.adiId=adiId;
		this.adiName=adiName;
		this.adiAttr=adiAttr;
		}
		#endregion
		
		#region 表AssDgItem的字段属性
		/// <summary>
		///主键
		/// </summary>
		public string AsisId
		{
			get {return asisId;}
			set {asisId=value;}
		}
		/// <summary>
		/// ADI_ID
		/// </summary>
		public string AdiId
		{
			get {return adiId;}
			set {adiId=value;}
		}
		/// <summary>
		/// ADI_NAME
		/// </summary>
		public string AdiName
		{
			get {return adiName;}
			set {adiName=value;}
		}
		/// <summary>
		///0表示此课目（内容）可选，1表示必选。
		/// </summary>
		public int AdiAttr
		{
			get {return adiAttr;}
			set {adiAttr=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoAssDgItem CopyTo(MoAssDgItem item)
        {
		    item.asisId=this.asisId;
		    item.adiId=this.adiId;
		    item.adiName=this.adiName;
		    item.adiAttr=this.adiAttr;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoAssDgItem mo=new MoAssDgItem();
		    mo.AsisId=this.AsisId;
		    mo.AdiId=this.AdiId;
		    mo.AdiName=this.AdiName;
		    mo.AdiAttr=this.AdiAttr;
			return mo;
		}
				///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {		 
            if (object.ReferenceEquals(this,obj))
            {
                return true;
            }
            else
            {
                MoAssDgItem NewAssDgItem = obj as MoAssDgItem;
                if (NewAssDgItem == null)
                {
                    return false;
                }
                else
                {
				if (NewAssDgItem.AsisId==this.AsisId && NewAssDgItem.AdiId==this.AdiId && NewAssDgItem.AdiName==this.AdiName && NewAssDgItem.AdiAttr==this.AdiAttr)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"AsisId={0}/AdiId={1}/AdiName={2}/AdiAttr={3}",asisId,adiId,adiName,adiAttr);
		 
		}
		#endregion
		
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Asis_ID"]!=null && row["Asis_ID"]!=DBNull.Value)
			{
			    this.AsisId = (string)row["Asis_ID"];
			}
			else
			{
				this.AsisId =string.Empty;
			}
		    if(row["ADI_ID"]!=null && row["ADI_ID"]!=DBNull.Value)
			{
			    this.AdiId = (string)row["ADI_ID"];
			}
			else
			{
				this.AdiId =string.Empty;
			}
		    if(row["ADI_NAME"]!=null && row["ADI_NAME"]!=DBNull.Value)
			{
			    this.AdiName = (string)row["ADI_NAME"];
			}
			else
			{
				this.AdiName =string.Empty;
			}
		    if(row["ADI_Attr"]!=null && row["ADI_Attr"]!=DBNull.Value)
			{
			    this.AdiAttr = (int)row["ADI_Attr"];
			}
			else
			{
				this.AdiAttr =0;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Asis_ID"] = this.AsisId;
			row["ADI_ID"] = this.AdiId;
			row["ADI_NAME"] = this.AdiName;
			row["ADI_Attr"] = this.AdiAttr;
		}
		#endregion
	}
}
#endregion
